package net.homelinux.ajay.net.ondisk.model.client;

import java.util.Vector;

public class AppObject {

  private Vector listeners = new Vector();

  public void addModelChangeListener(ModelChangeListener item) {
    listeners.add(item);
   }

  public ModelChangeListener removeModelChangeListener(ModelChangeListener item) {
    return listeners.remove(item)?item:null;
  }

  protected void fireChangeListeners() {
    for (int i = 0; i < listeners.size(); i++) {
      ModelChangeListener listener = (ModelChangeListener) listeners.get(i);
      listener.onModelChange(this);
    }
  }

}
